import { defineStore } from "pinia"

/**
 * 选项式api使用
 */
export const useCounterStore = defineStore('counter', {
    state (){
        return {
            name:'my name is pinia',
            age:'24',
        }
    },
    getters:{
        fullName(state){
            return state.name+'---my age is '+state.age;
        }
    },
    actions:{
        getName(){
            console.log(this.name)
            alert(this.name)
        }
    }
})